3 * Kazakh (Қазақша) specific code.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
29 // phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
30 class LanguageKk_cyrl
extends Language
{
31 # Convert from the nominative form of a noun to some other case
32 # Invoked with {{GRAMMAR:case|word}}
34 * Cases: genitive, dative, accusative, locative, ablative, comitative + possessive forms
41 function convertGrammarKk_cyrl( $word, $case ) {
42 global $wgGrammarForms;
43 if ( isset( $wgGrammarForms['kk-kz'][$case][$word] ) ) {
44 return $wgGrammarForms['kk-kz'][$case][$word];
46 if ( isset( $wgGrammarForms['kk-cyrl'][$case][$word] ) ) {
47 return $wgGrammarForms['kk-cyrl'][$case][$word];
49 // Set up some constants...
50 // Vowels in last syllable
51 $frontVowels = [ "е", "ө", "ү", "і", "ә", "э", "я", "ё", "и" ];
52 $backVowels = [ "а", "о", "ұ", "ы" ];
53 $allVowels = [ "е", "ө", "ү", "і", "ә", "э", "а", "о", "ұ", "ы", "я", "ё", "и" ];
55 $Nasals = [ "м", "н", "ң" ];
56 $Sonants = [ "и", "й", "л", "р", "у", "ю" ];
57 $Consonants = [ "п", "ф", "к", "қ", "т", "ш", "с", "х", "ц", "ч", "щ", "б", "в", "г", "д" ];
58 $Sibilants = [ "ж", "з" ];
59 $Sonorants = [ "и", "й", "л", "р", "у", "ю", "м", "н", "ң", "ж", "з" ];
62 $firstPerson = [ "м", "ң" ]; // 1st singular, 2nd unformal
63 $secondPerson = [ "з" ]; // 1st plural, 2nd formal
64 $thirdPerson = [ "ы", "і" ]; // 3rd
66 $lastLetter = $this->lastLetter( $word, $allVowels );
67 $wordEnding =& $lastLetter[0];
68 $wordLastVowel =& $lastLetter[1];
70 // Now convert the word
73 case "genitive": # ilik
74 if ( in_array( $wordEnding, $Consonants ) ) {
75 if ( in_array( $wordLastVowel, $frontVowels ) ) {
77 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
80 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ) {
81 if ( in_array( $wordLastVowel, $frontVowels ) ) {
83 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
86 } elseif ( in_array( $wordEnding, $Sonants ) ||
in_array( $wordEnding, $Sibilants ) ) {
87 if ( in_array( $wordLastVowel, $frontVowels ) ) {
89 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
95 case "dative": # barıs
96 if ( in_array( $wordEnding, $Consonants ) ) {
97 if ( in_array( $wordLastVowel, $frontVowels ) ) {
99 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
102 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
103 if ( in_array( $wordLastVowel, $frontVowels ) ) {
105 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
111 case "possessive dative": # täweldık + barıs
112 if ( in_array( $wordEnding, $firstPerson ) ) {
113 if ( in_array( $wordLastVowel, $frontVowels ) ) {
115 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
118 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
119 if ( in_array( $wordLastVowel, $frontVowels ) ) {
121 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
124 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
125 if ( in_array( $wordLastVowel, $frontVowels ) ) {
127 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
133 case "accusative": # tabıs
134 if ( in_array( $wordEnding, $Consonants ) ) {
135 if ( in_array( $wordLastVowel, $frontVowels ) ) {
137 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
140 } elseif ( in_array( $wordEnding, $allVowels ) ) {
141 if ( in_array( $wordLastVowel, $frontVowels ) ) {
143 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
146 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
147 if ( in_array( $wordLastVowel, $frontVowels ) ) {
149 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
155 case "possessive accusative": # täweldık + tabıs
156 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
157 if ( in_array( $wordLastVowel, $frontVowels ) ) {
159 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
162 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
167 case "locative": # jatıs
168 if ( in_array( $wordEnding, $Consonants ) ) {
169 if ( in_array( $wordLastVowel, $frontVowels ) ) {
171 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
174 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
175 if ( in_array( $wordLastVowel, $frontVowels ) ) {
177 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
183 case "possessive locative": # täweldık + jatıs
184 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
185 if ( in_array( $wordLastVowel, $frontVowels ) ) {
187 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
190 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
191 if ( in_array( $wordLastVowel, $frontVowels ) ) {
193 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
199 case "ablative": # şığıs
200 if ( in_array( $wordEnding, $Consonants ) ) {
201 if ( in_array( $wordLastVowel, $frontVowels ) ) {
203 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
206 } elseif ( in_array( $wordEnding, $allVowels )
207 ||
in_array( $wordEnding, $Sonants )
208 ||
in_array( $wordEnding, $Sibilants )
210 if ( in_array( $wordLastVowel, $frontVowels ) ) {
212 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
215 } elseif ( in_array( $wordEnding, $Nasals ) ) {
216 if ( in_array( $wordLastVowel, $frontVowels ) ) {
218 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
224 case "possessive ablative": # täweldık + şığıs
225 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $thirdPerson ) ) {
226 if ( in_array( $wordLastVowel, $frontVowels ) ) {
228 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
231 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
232 if ( in_array( $wordLastVowel, $frontVowels ) ) {
234 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
240 case "comitative": # kömektes
241 if ( in_array( $wordEnding, $Consonants ) ) {
243 } elseif ( in_array( $wordEnding, $allVowels )
244 ||
in_array( $wordEnding, $Nasals )
245 ||
in_array( $wordEnding, $Sonants )
248 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
253 case "possessive comitative": # täweldık + kömektes
254 if ( in_array( $wordEnding, $Consonants ) ) {
256 } elseif ( in_array( $wordEnding, $allVowels )
257 ||
in_array( $wordEnding, $Nasals )
258 ||
in_array( $wordEnding, $Sonants )
261 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
265 default: # dc0 #nominative #ataw
271 * @param string $word
272 * @param string $case
275 function convertGrammarKk_latn( $word, $case ) {
276 global $wgGrammarForms;
277 if ( isset( $wgGrammarForms['kk-tr'][$case][$word] ) ) {
278 return $wgGrammarForms['kk-tr'][$case][$word];
280 if ( isset( $wgGrammarForms['kk-latn'][$case][$word] ) ) {
281 return $wgGrammarForms['kk-latn'][$case][$word];
283 // Set up some constants...
284 // Vowels in last syllable
285 $frontVowels = [ "e", "ö", "ü", "i", "ä", "é" ];
286 $backVowels = [ "a", "o", "u", "ı" ];
287 $allVowels = [ "e", "ö", "ü", "i", "ä", "é", "a", "o", "u", "ı" ];
289 $Nasals = [ "m", "n", "ñ" ];
290 $Sonants = [ "ï", "y", "ý", "l", "r", "w" ];
291 $Consonants = [ "p", "f", "k", "q", "t", "ş", "s", "x", "c", "ç", "b", "v", "g", "d" ];
292 $Sibilants = [ "j", "z" ];
293 $Sonorants = [ "ï", "y", "ý", "l", "r", "w", "m", "n", "ñ", "j", "z" ];
296 $firstPerson = [ "m", "ñ" ]; // 1st singular, 2nd unformal
297 $secondPerson = [ "z" ]; // 1st plural, 2nd formal
298 $thirdPerson = [ "ı", "i" ]; // 3rd
300 $lastLetter = $this->lastLetter( $word, $allVowels );
301 $wordEnding =& $lastLetter[0];
302 $wordLastVowel =& $lastLetter[1];
304 // Now convert the word
307 case "genitive": # ilik
308 if ( in_array( $wordEnding, $Consonants ) ) {
309 if ( in_array( $wordLastVowel, $frontVowels ) ) {
311 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
314 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ) {
315 if ( in_array( $wordLastVowel, $frontVowels ) ) {
317 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
320 } elseif ( in_array( $wordEnding, $Sonants ) ||
in_array( $wordEnding, $Sibilants ) ) {
321 if ( in_array( $wordLastVowel, $frontVowels ) ) {
323 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
329 case "dative": # barıs
330 if ( in_array( $wordEnding, $Consonants ) ) {
331 if ( in_array( $wordLastVowel, $frontVowels ) ) {
333 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
336 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
337 if ( in_array( $wordLastVowel, $frontVowels ) ) {
339 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
345 case "possessive dative": # täweldık + barıs
346 if ( in_array( $wordEnding, $firstPerson ) ) {
347 if ( in_array( $wordLastVowel, $frontVowels ) ) {
349 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
352 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
353 if ( in_array( $wordLastVowel, $frontVowels ) ) {
355 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
358 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
359 if ( in_array( $wordLastVowel, $frontVowels ) ) {
361 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
367 case "accusative": # tabıs
368 if ( in_array( $wordEnding, $Consonants ) ) {
369 if ( in_array( $wordLastVowel, $frontVowels ) ) {
371 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
374 } elseif ( in_array( $wordEnding, $allVowels ) ) {
375 if ( in_array( $wordLastVowel, $frontVowels ) ) {
377 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
380 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
381 if ( in_array( $wordLastVowel, $frontVowels ) ) {
383 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
389 case "possessive accusative": # täweldık + tabıs
390 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
391 if ( in_array( $wordLastVowel, $frontVowels ) ) {
393 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
396 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
401 case "locative": # jatıs
402 if ( in_array( $wordEnding, $Consonants ) ) {
403 if ( in_array( $wordLastVowel, $frontVowels ) ) {
405 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
408 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
409 if ( in_array( $wordLastVowel, $frontVowels ) ) {
411 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
417 case "possessive locative": # täweldık + jatıs
418 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
419 if ( in_array( $wordLastVowel, $frontVowels ) ) {
421 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
424 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
425 if ( in_array( $wordLastVowel, $frontVowels ) ) {
427 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
433 case "ablative": # şığıs
434 if ( in_array( $wordEnding, $Consonants ) ) {
435 if ( in_array( $wordLastVowel, $frontVowels ) ) {
437 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
440 } elseif ( in_array( $wordEnding, $allVowels )
441 ||
in_array( $wordEnding, $Sonants )
442 ||
in_array( $wordEnding, $Sibilants )
444 if ( in_array( $wordLastVowel, $frontVowels ) ) {
446 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
449 } elseif ( in_array( $wordEnding, $Nasals ) ) {
450 if ( in_array( $wordLastVowel, $frontVowels ) ) {
452 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
458 case "possessive ablative": # täweldık + şığıs
459 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $thirdPerson ) ) {
460 if ( in_array( $wordLastVowel, $frontVowels ) ) {
462 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
465 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
466 if ( in_array( $wordLastVowel, $frontVowels ) ) {
468 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
474 case "comitative": # kömektes
475 if ( in_array( $wordEnding, $Consonants ) ) {
477 } elseif ( in_array( $wordEnding, $allVowels )
478 ||
in_array( $wordEnding, $Nasals )
479 ||
in_array( $wordEnding, $Sonants )
482 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
487 case "possessive comitative": # täweldık + kömektes
488 if ( in_array( $wordEnding, $Consonants ) ) {
490 } elseif ( in_array( $wordEnding, $allVowels )
491 ||
in_array( $wordEnding, $Nasals )
492 ||
in_array( $wordEnding, $Sonants )
495 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
499 default: # dc0 #nominative #ataw
505 * @param string $word
506 * @param string $case
509 function convertGrammarKk_arab( $word, $case ) {
510 global $wgGrammarForms;
511 if ( isset( $wgGrammarForms['kk-cn'][$case][$word] ) ) {
512 return $wgGrammarForms['kk-cn'][$case][$word];
514 if ( isset( $wgGrammarForms['kk-arab'][$case][$word] ) ) {
515 return $wgGrammarForms['kk-arab'][$case][$word];
517 // Set up some constants...
518 // Vowels in last syllable
519 $frontVowels = [ "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە" ];
520 $backVowels = [ "ا", "و", "ۇ", "ى" ];
521 $allVowels = [ "ە", "ٶ", "ٷ", "ٸ", "ٵ", "ە", "ا", "و", "ۇ", "ى" ];
523 $Nasals = [ "م", "ن", "ڭ" ];
524 $Sonants = [ "ي", "ي", "ل", "ر", "ۋ" ];
525 $Consonants = [ "پ", "ف", "ك", "ق", "ت", "ش", "س", "ح", "تس", "چ", "ب", "ۆ", "گ", "د" ];
526 $Sibilants = [ "ج", "ز" ];
527 $Sonorants = [ "ي", "ي", "ل", "ر", "ۋ", "م", "ن", "ڭ", "ج", "ز" ];
530 $firstPerson = [ "م", "ڭ" ]; // 1st singular, 2nd unformal
531 $secondPerson = [ "ز" ]; // 1st plural, 2nd formal
532 $thirdPerson = [ "ى", "ٸ" ]; // 3rd
534 $lastLetter = $this->lastLetter( $word, $allVowels );
535 $wordEnding = $lastLetter[0];
536 $wordLastVowel = $lastLetter[1];
538 // Now convert the word
541 case "genitive": # ilik
542 if ( in_array( $wordEnding, $Consonants ) ) {
543 if ( in_array( $wordLastVowel, $frontVowels ) ) {
545 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
548 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Nasals ) ) {
549 if ( in_array( $wordLastVowel, $frontVowels ) ) {
551 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
554 } elseif ( in_array( $wordEnding, $Sonants ) ||
in_array( $wordEnding, $Sibilants ) ) {
555 if ( in_array( $wordLastVowel, $frontVowels ) ) {
557 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
563 case "dative": # barıs
564 if ( in_array( $wordEnding, $Consonants ) ) {
565 if ( in_array( $wordLastVowel, $frontVowels ) ) {
567 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
570 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
571 if ( in_array( $wordLastVowel, $frontVowels ) ) {
573 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
579 case "possessive dative": # täweldık + barıs
580 if ( in_array( $wordEnding, $firstPerson ) ) {
581 if ( in_array( $wordLastVowel, $frontVowels ) ) {
583 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
586 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
587 if ( in_array( $wordLastVowel, $frontVowels ) ) {
589 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
592 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
593 if ( in_array( $wordLastVowel, $frontVowels ) ) {
595 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
601 case "accusative": # tabıs
602 if ( in_array( $wordEnding, $Consonants ) ) {
603 if ( in_array( $wordLastVowel, $frontVowels ) ) {
605 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
608 } elseif ( in_array( $wordEnding, $allVowels ) ) {
609 if ( in_array( $wordLastVowel, $frontVowels ) ) {
611 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
614 } elseif ( in_array( $wordEnding, $Sonorants ) ) {
615 if ( in_array( $wordLastVowel, $frontVowels ) ) {
617 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
623 case "possessive accusative": # täweldık + tabıs
624 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
625 if ( in_array( $wordLastVowel, $frontVowels ) ) {
627 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
630 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
635 case "locative": # jatıs
636 if ( in_array( $wordEnding, $Consonants ) ) {
637 if ( in_array( $wordLastVowel, $frontVowels ) ) {
639 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
642 } elseif ( in_array( $wordEnding, $allVowels ) ||
in_array( $wordEnding, $Sonorants ) ) {
643 if ( in_array( $wordLastVowel, $frontVowels ) ) {
645 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
651 case "possessive locative": # täweldık + jatıs
652 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $secondPerson ) ) {
653 if ( in_array( $wordLastVowel, $frontVowels ) ) {
655 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
658 } elseif ( in_array( $wordEnding, $thirdPerson ) ) {
659 if ( in_array( $wordLastVowel, $frontVowels ) ) {
661 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
667 case "ablative": # şığıs
668 if ( in_array( $wordEnding, $Consonants ) ) {
669 if ( in_array( $wordLastVowel, $frontVowels ) ) {
671 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
674 } elseif ( in_array( $wordEnding, $allVowels )
675 ||
in_array( $wordEnding, $Sonants )
676 ||
in_array( $wordEnding, $Sibilants )
678 if ( in_array( $wordLastVowel, $frontVowels ) ) {
680 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
683 } elseif ( in_array( $wordEnding, $Nasals ) ) {
684 if ( in_array( $wordLastVowel, $frontVowels ) ) {
686 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
692 case "possessive ablative": # täweldık + şığıs
693 if ( in_array( $wordEnding, $firstPerson ) ||
in_array( $wordEnding, $thirdPerson ) ) {
694 if ( in_array( $wordLastVowel, $frontVowels ) ) {
696 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
699 } elseif ( in_array( $wordEnding, $secondPerson ) ) {
700 if ( in_array( $wordLastVowel, $frontVowels ) ) {
702 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
708 case "comitative": # kömektes
709 if ( in_array( $wordEnding, $Consonants ) ) {
711 } elseif ( in_array( $wordEnding, $allVowels )
712 ||
in_array( $wordEnding, $Nasals )
713 ||
in_array( $wordEnding, $Sonants )
716 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
721 case "possessive comitative": # täweldık + kömektes
722 if ( in_array( $wordEnding, $Consonants ) ) {
724 } elseif ( in_array( $wordEnding, $allVowels )
725 ||
in_array( $wordEnding, $Nasals )
726 ||
in_array( $wordEnding, $Sonants )
729 } elseif ( in_array( $wordEnding, $Sibilants ) ) {
733 default: # dc0 #nominative #ataw
739 * @param string $word
740 * @param array $allVowels
743 function lastLetter( $word, $allVowels ) {
746 // Put the word in a form we can play with since we're using UTF-8
747 $ar = preg_split( '//u', parent
::lc( $word ), -1, PREG_SPLIT_NO_EMPTY
);
749 // Here's an array with the order of the letters in the word reversed
750 // so we can find a match quicker *shrug*
751 $wordReversed = array_reverse( $ar );
753 // Here's the last letter in the word
754 $lastLetter[0] = $ar[count( $ar ) - 1];
756 // Find the last vowel in the word
757 $lastLetter[1] = null;
758 foreach ( $wordReversed as $xvalue ) {
759 foreach ( $allVowels as $yvalue ) {
760 if ( strcmp( $xvalue, $yvalue ) == 0 ) {
761 $lastLetter[1] = $xvalue;
765 if ( $lastLetter[1] !== null ) {